package com.cloud.pole.common.enums;


/**
 * 异常编码
 */
public enum ErrorStatusEnum {
    

    /**
     * 用户、客户端、授权
     */
    UC_EX_USER_INVALID_CODE(-40101, "用户token错误"),
    UC_EX_CLIENT_INVALID_CODE(-40301, "客户端不合法"),
    UC_EX_CLIENT_FORBIDDEN_CODE(-40331, "客户端被拒绝"),
    UC_EX_TOKEN_INVALID_CODE(-40301, "TOKEN不合法"),
    UC_EX_TOKEN_FORBIDDEN_CODE(-40331, "TOKEN被拒绝"),
    ;


    private int status;
    private String msg;

    /**
     * Msg string.
     *
     * @return the string
     */
    public String msg() {
        return msg;
    }

    /**
     * Code int.
     *
     * @return the int
     */
    public int status() {
        return status;
    }

    ErrorStatusEnum(int status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    /**
     * Gets enum.
     *
     * @return the enum
     */
    public static ErrorStatusEnum getEnum(int status) {
        for (ErrorStatusEnum ele : ErrorStatusEnum.values()) {
            if (ele.status() == status) {
                return ele;
            }
        }
        return null;
    }
}
